import React,{useState,useEffect} from "react";
import { Typography } from "antd";

const CartItem=(props)=>{
    const {item,onCheckedChange}=props
    const {checked,name,price}=item

    // const onWrapCheckedChange=(e)=>{
    //     onCheckedChange(item)
    // }

    return(
        <div>
            <div className="item-card">
                <div className="checkbox-wrap">
                    <input 
                    type="checkbox"
                    checked={checked}
                    onChange={onCheckedChange.bind(null,item)} 
                    name="" id="" />
                </div>
            </div>
            <p className="item-info">
                {name} <Typography.Text mark>${price}</Typography.Text>
            </p>
        </div>
    )
}

export default CartItem 